#include "RingReply.h"

#include <stdlib.h>
#include <sstream>
#include <stdio.h>

#include <Poco/DOM/Document.h>
#include <Poco/DOM/NodeIterator.h>
#include <Poco/Base64Encoder.h>
#include <Poco/Base64Decoder.h>
#include <Poco/StreamCopier.h>
#include "misc/Interface.h"
#include "misc/Debug.h"
#include "nameserver/NameServer.h"
/*********************************************************/
void RingReply::execute()
{
	// Name server doesn't execute ringreply message, do nothing
}
/*********************************************************/
std::string RingReply::serialize() const
{
	NameServer& ns = NameServer::Instance();
	std::ostringstream		ostr;
	id = ns.getID();

	ostr << "<GS id='" << ns.getID() << "'>";
	ostr << "<RingReply>" << host << "</RingReply>";
	ostr << "</GS>";

	return( ostr.str() );
}
/*********************************************************/
void RingReply::deserialize(Poco::XML::NodeIterator& it)
{
	// Name server is the only one sending ring reply messages so we don't do anything here
}
/*********************************************************/
void RingReply::setHost(const std::string& n)
{
	host = n;
}
/*********************************************************/
std::string RingReply::getHost() const
{
	return host;
}
/*********************************************************/
